library(knitr)netlit R PackageThe netlit package provides functions to generate network statistics from a literature review. Specifically, netlit provides a wrapper for igraph functions to facilitate using network analysis in literature reviews.
Install this package with
devtools::install_github("judgelord/netlit")
To install netlit from CRAN, run the following:
install.packages("netlit")
The review() function takes in a dataframe, data, that includes from and to columns (a directed graph structure).
In the example below, we use example data from this project on redistricting. These data are a set of related concepts (from and to) in the redistricting literature and citations for these relationships (cites and cites_empirical). See vignette("netlit") for more details on this example.
library(netlit)
data("literature")
literature %>% kable()| to | from | cites | cites_empirical |
|---|---|---|---|
| detect gerrymandering | computers | Altman & McDonald 2010; Wang 2016; Altman & McDonald 2011; Ramachandran & Gold 2018 | Wang 2016 |
| public participation | computers | Altman & McDonald 2010; Altman & McDonald 2011 | NA |
| preserve communities of interest | number of competitive districts | Gimpel & Harbridge-Yong 2020 | Gimpel & Harbridge-Yong 2020 |
| proportionality | partisan advantage | Caughey et al. 2017; Tamas 2019 | NA |
| efficiency gap | partisan gerrymandering | Chen 2017 | Chen 2017 |
| constitutional test | preserve communities of interest | Stephanopoulos 2012 | NA |
| detect gerrymandering | mean-median vote comparison | McDonald & Best 2015; Wang 2016; Wang 2016b | Wang 2016b |
| constitutional test | mean-median vote comparison | McDonald & Best 2015, Best et al. 2018 | NA |
| constitutional test | partisan gerrymandering | Kang 2017 | NA |
| instability | partisan gerrymandering | Yoshinaka & Murhpy 2011 | Yoshinaka & Murhpy 2011 |
| elite polarization | partisan gerrymandering | Masket et al. 2012 | Masket et al. 2012 |
| number of minority representatives | majority minority districts | Atsusaka 2021 | Atsusaka 2021 |
| partisan advantage | majority minority districts | Cox & Holden 2011; Sabouni & Shelton 2021 | Sabouni & Shelton 2021 |
| voter turnout | majority minority districts | Fraga 2016 | Fraga 2016 |
| partisan advantage | redistricting commission | Cain 2011 | NA |
| partisan donor advantage | partisan gerrymandering | Kirkland 2013 | Kirkland 2013 |
| legislator voting | change in constituency boundaries | Bertelli & Carson 2011, Hayes et al. 2010 | Bertelli & Carson 2011, Hayes et al. 2010 |
| legislative outcomes | change in constituency boundaries | Bertelli & Carson 2011, Gul & Pesendorfer 2010 | Bertelli & Carson 2011 |
| voter turnout | competitiveness | Moskowitz & Schneer 2019; Hunt 2018 | Moskowitz & Schneer 2019; Hunt 2018 |
| elite polarization | sorting | Krasa & Polborn 2018 | Krasa & Polborn 2018 |
| partisan advantage | contiguity | Chen & Rodden 2013 | Chen & Rodden 2013 |
| incumbent vote share | electorate composition change | Hood & McKee 2013; Ansolabehere & Snyder 2012 | Hood & McKee 2013; Ansolabehere & Snyder 2012 |
| personal vote | electorate composition change | Carsey et al. 2017, Bertelli & Carson 2011 | Carsey et al. 2017 |
| pork spending | house-senate delegation alignment | Chen 2010 | NA |
| voter sense of place | stability in voters’ fellow constituents | Hayes & McKee 2011 | Hayes & McKee 2011 |
| voter information about their district | change in constituency boundaries | Winburn & Wagner 2010 | NA |
| rolloff | voter information about their district | Winburn & Wagner 2010 | Winburn & Wagner 2010 |
| voter turnout | voter information about their district | Winburn & Wagner 2010 | Winburn & Wagner 2010 |
| split ticket voting | voter information about their district | Winburn & Wagner 2010 | Winburn & Wagner 2010 |
| campaign resource allocation | electorate composition change | Limbocker & You 2020 | Limbocker & You 2020 |
| partisan advantage | geographic partisan distribution | Chen & Rodden 2013; Duchin et al. 2019; Powell et al. 2020 | Chen & Rodden 2013; Duchin et al. 2019; Powell et al. 2020 |
| stability in voters’ fellow constituents | preserve communities of interest | Winburn & Wagner 2010 | NA |
| voter information about their district | preserve communities of interest | Winburn & Wagner 2010 | NA |
| rolloff | preserve communities of interest | Hayes & McKee 2011; Winburn & Wagner 2010 | Hayes & McKee 2011 |
| elite polarization | number of competitive districts | Grainger 2010 | Grainger 2010 |
| floor votes align with district preferences | partisan advantage | Caughey et al. 2017 | NA |
| floor votes align with state preferences | partisan advantage | Caughey et al. 2017 | NA |
| partisan advantage | partisan advantage | Arrington 2016; Campisi et al. 2019; Katz, King & Rosenblatt 2020 | NA |
| legislator voting | partisan advantage | Lo 2013 | Lo 2013 |
| elite polarization | partisan advantage | Lo 2013 | NA |
| efficiency gap | partisan advantage | Chen & Cottrell 2016 | Chen & Cottrell 2016 |
| number of competitive districts | partisan advantage | Goedert 2017; Goedert 2014 | Goedert 2017, Yoshinaka & Murhpy 2011; Goedert 2014 |
| house-senate delegation alignment | proportionality | Chen 2010 | NA |
| minority representation | compactness | Webster 2013 | NA |
| compactness | compactness | Barnes & Solomon 2020; Gatesman & Unwin 2021; Magleby & Mosesson 2018; De Assis et al. 2014; Altman & McDonald 2011; Liu et al. 2016, Chen & Rodden 2015, Tam Cho & Liu 2016, Saxon 2020 | Barnes & Solomon 2020; Magleby & Mosesson 2018; De Assis et al. 2014; Chen & Rodden 2015, Tam Cho & Liu 2016, Saxon 2020 |
| efficiency gap | efficiency gap | Stephanopoulos & McGhee 2015, McGhee 2014 | McGhee 2014 |
| equal population | equal population | Gatesman & Unwin 2021; Magleby & Mosesson 2018 | Magleby & Mosesson 2018 |
| majority representation | redistricting commission | Matsusaka 2010 | Matsusaka 2010 |
| elite ideological moderation | redistricting commission | McGhee & Shor 2017 | McGhee & Shor 2017 |
| competitiveness | redistricting commission | Carson et al. 2014, Grainger 2010, Masket et al. 2012; Goedert 2014 | Carson et al. 2014, Grainger 2010, Masket et al. 2012; Goedert 2014 |
| competitiveness | redistricting by courts | Carson et al. 2014 | Carson et al. 2014 |
| legislative majority-seeking behavior | upcoming redistricting | Makse 2014 | Makse 2014 |
| partisan dislocation | partisan dislocation | Deford, Eubank & Rodden 2020 | NA |
| voter turnout | compactness | Ladewig 2018 | Ladewig 2018 |
| preserve communities of interest | preserve communities of interest | Makse 2012 | Makse 2012 |
| partisan advantage | partisan gerrymandering | Wang 2016; Cox & Holden 2011; Sabouni & Shelton 2021; Powell et al. 2020 | Cox & Holden 2011; Sabouni & Shelton 2021; Powell et al. 2020 |
| partisan gerrymandering | preserve communities of interest | Sabouni & Shelton 2021 | Sabouni & Shelton 2021 |
| candidate quality | redistricting commission | Williamson 2019 | Williamson 2019 |
| efficiency principle | efficiency gap | Veomett 2018 | NA |
| efficiency gap | wasted votes | McGhee 2017 | NA |
| ideological representation | efficiency gap | Caughey et al. 2017b | Caughey et al. 2017b |
| support for redistricting process | identification with governing party | Fougere et al. 2010 | Fougere et al. 2010 |
| support for redistricting process | redistricting commission | Fougere et al. 2010 | Fougere et al. 2010 |
| proportionality | efficiency gap | Warrington 2018 | NA |
| issue salience | change in constituency boundaries | Gardner 2012 | NA |
| degree of political conflict | change in constituency boundaries | Gardner 2012 | NA |
| majority representation | partisan gerrymandering | Goedert 2014; Nagle 2019 | NA |
| inequality of opportunity vs outcome | detect gerrymandering | Wang et al. 2018 | NA |
| electorate composition change | change in constituency boundaries | Bertelli & Carson 2011; Hood & McKee 2013; Ansolabehere & Snyder 2012 | Bertelli & Carson 2011; Hood & McKee 2013; Ansolabehere & Snyder 2012 |
netlit offers four main functions: make_edgelist(), make_nodelist(), augment_nodelist(), and review().
review() is the primary function. The others are helper functions that perform the individual steps that review() does all at once. review() takes in a dataframe with at least two columns representing linked concepts (e.g., a cause and an effect) and returns data augmented with network statistics. Users must either specify “from” nodes and “to” nodes with the from and to arguments or include columns named from and to in the supplied data object.
review() returns a list of three objects:
edgelist (a list of relationships with edge_betweenness calculated),nodelist (a list of concepts with degree and betweenness calculated), andgraph object suitable for use in other igraph functions or other network visualization packages.Users may wish to include edge attributes (e.g., information about the relationship between the two concepts) or node attributes (information about each concept). We show how to do so below. But first, consider the basic use of review():
lit <- review(literature, from = "from", to = "to")
lit## A netlit_review object with the following components:
##
## $edgelist
## - 69 edges
## - edge attributes: edge_betweenness
## $nodelist
## - 56 nodes
## - node attributes: degree_in, degree_out, degree_total, betweenness
## $graph
## an igraph object
edges <- lit$edgelist
edges %>% kable()| from | to | edge_betweenness |
|---|---|---|
| computers | detect gerrymandering | 2.0 |
| computers | public participation | 1.0 |
| number of competitive districts | preserve communities of interest | 86.0 |
| partisan advantage | proportionality | 19.5 |
| partisan gerrymandering | efficiency gap | 13.5 |
| preserve communities of interest | constitutional test | 7.0 |
| mean-median vote comparison | detect gerrymandering | 2.0 |
| mean-median vote comparison | constitutional test | 1.0 |
| partisan gerrymandering | constitutional test | 1.0 |
| partisan gerrymandering | instability | 8.0 |
| partisan gerrymandering | elite polarization | 2.0 |
| majority minority districts | number of minority representatives | 1.0 |
| majority minority districts | partisan advantage | 23.0 |
| majority minority districts | voter turnout | 1.0 |
| redistricting commission | partisan advantage | 22.0 |
| partisan gerrymandering | partisan donor advantage | 8.0 |
| change in constituency boundaries | legislator voting | 1.0 |
| change in constituency boundaries | legislative outcomes | 1.0 |
| competitiveness | voter turnout | 3.0 |
| sorting | elite polarization | 1.0 |
| contiguity | partisan advantage | 24.0 |
| electorate composition change | incumbent vote share | 2.0 |
| electorate composition change | personal vote | 2.0 |
| house-senate delegation alignment | pork spending | 12.0 |
| stability in voters’ fellow constituents | voter sense of place | 9.0 |
| change in constituency boundaries | voter information about their district | 4.0 |
| voter information about their district | rolloff | 2.0 |
| voter information about their district | voter turnout | 8.0 |
| voter information about their district | split ticket voting | 10.0 |
| electorate composition change | campaign resource allocation | 2.0 |
| geographic partisan distribution | partisan advantage | 24.0 |
| preserve communities of interest | stability in voters’ fellow constituents | 16.0 |
| preserve communities of interest | voter information about their district | 22.0 |
| preserve communities of interest | rolloff | 8.0 |
| number of competitive districts | elite polarization | 1.0 |
| partisan advantage | floor votes align with district preferences | 8.0 |
| partisan advantage | floor votes align with state preferences | 8.0 |
| partisan advantage | partisan advantage | 0.0 |
| partisan advantage | legislator voting | 8.0 |
| partisan advantage | elite polarization | 5.0 |
| partisan advantage | efficiency gap | 15.0 |
| partisan advantage | number of competitive districts | 71.0 |
| proportionality | house-senate delegation alignment | 22.0 |
| compactness | minority representation | 1.0 |
| compactness | compactness | 0.0 |
| efficiency gap | efficiency gap | 0.0 |
| equal population | equal population | 0.0 |
| redistricting commission | majority representation | 1.0 |
| redistricting commission | elite ideological moderation | 1.0 |
| redistricting commission | competitiveness | 2.0 |
| redistricting by courts | competitiveness | 2.0 |
| upcoming redistricting | legislative majority-seeking behavior | 1.0 |
| partisan dislocation | partisan dislocation | 0.0 |
| compactness | voter turnout | 1.0 |
| preserve communities of interest | preserve communities of interest | 0.0 |
| partisan gerrymandering | partisan advantage | 25.5 |
| preserve communities of interest | partisan gerrymandering | 49.0 |
| redistricting commission | candidate quality | 1.0 |
| efficiency gap | efficiency principle | 10.0 |
| wasted votes | efficiency gap | 6.0 |
| efficiency gap | ideological representation | 10.0 |
| identification with governing party | support for redistricting process | 1.0 |
| redistricting commission | support for redistricting process | 1.0 |
| efficiency gap | proportionality | 10.5 |
| change in constituency boundaries | issue salience | 1.0 |
| change in constituency boundaries | degree of political conflict | 1.0 |
| partisan gerrymandering | majority representation | 7.0 |
| detect gerrymandering | inequality of opportunity vs outcome | 3.0 |
| change in constituency boundaries | electorate composition change | 4.0 |
nodes <- lit$nodelist
nodes %>% kable()| node | degree_in | degree_out | degree_total | betweenness |
|---|---|---|---|---|
| computers | 0 | 2 | 2 | 0.0 |
| number of competitive districts | 1 | 2 | 3 | 64.0 |
| partisan advantage | 6 | 8 | 14 | 111.5 |
| partisan gerrymandering | 1 | 7 | 8 | 42.0 |
| preserve communities of interest | 2 | 6 | 8 | 79.0 |
| mean-median vote comparison | 0 | 2 | 2 | 0.0 |
| majority minority districts | 0 | 3 | 3 | 0.0 |
| redistricting commission | 0 | 6 | 6 | 0.0 |
| change in constituency boundaries | 0 | 6 | 6 | 0.0 |
| competitiveness | 2 | 1 | 3 | 2.0 |
| sorting | 0 | 1 | 1 | 0.0 |
| contiguity | 0 | 1 | 1 | 0.0 |
| electorate composition change | 1 | 3 | 4 | 3.0 |
| house-senate delegation alignment | 1 | 1 | 2 | 11.0 |
| stability in voters’ fellow constituents | 1 | 1 | 2 | 8.0 |
| voter information about their district | 2 | 3 | 5 | 17.0 |
| geographic partisan distribution | 0 | 1 | 1 | 0.0 |
| proportionality | 2 | 1 | 3 | 20.0 |
| compactness | 1 | 3 | 4 | 0.0 |
| efficiency gap | 4 | 4 | 8 | 25.5 |
| equal population | 1 | 1 | 2 | 0.0 |
| redistricting by courts | 0 | 1 | 1 | 0.0 |
| upcoming redistricting | 0 | 1 | 1 | 0.0 |
| partisan dislocation | 1 | 1 | 2 | 0.0 |
| wasted votes | 0 | 1 | 1 | 0.0 |
| identification with governing party | 0 | 1 | 1 | 0.0 |
| detect gerrymandering | 2 | 1 | 3 | 2.0 |
| public participation | 1 | 0 | 1 | 0.0 |
| constitutional test | 3 | 0 | 3 | 0.0 |
| instability | 1 | 0 | 1 | 0.0 |
| elite polarization | 4 | 0 | 4 | 0.0 |
| number of minority representatives | 1 | 0 | 1 | 0.0 |
| voter turnout | 4 | 0 | 4 | 0.0 |
| partisan donor advantage | 1 | 0 | 1 | 0.0 |
| legislator voting | 2 | 0 | 2 | 0.0 |
| legislative outcomes | 1 | 0 | 1 | 0.0 |
| incumbent vote share | 1 | 0 | 1 | 0.0 |
| personal vote | 1 | 0 | 1 | 0.0 |
| pork spending | 1 | 0 | 1 | 0.0 |
| voter sense of place | 1 | 0 | 1 | 0.0 |
| rolloff | 2 | 0 | 2 | 0.0 |
| split ticket voting | 1 | 0 | 1 | 0.0 |
| campaign resource allocation | 1 | 0 | 1 | 0.0 |
| floor votes align with district preferences | 1 | 0 | 1 | 0.0 |
| floor votes align with state preferences | 1 | 0 | 1 | 0.0 |
| minority representation | 1 | 0 | 1 | 0.0 |
| majority representation | 2 | 0 | 2 | 0.0 |
| elite ideological moderation | 1 | 0 | 1 | 0.0 |
| legislative majority-seeking behavior | 1 | 0 | 1 | 0.0 |
| candidate quality | 1 | 0 | 1 | 0.0 |
| efficiency principle | 1 | 0 | 1 | 0.0 |
| ideological representation | 1 | 0 | 1 | 0.0 |
| support for redistricting process | 2 | 0 | 2 | 0.0 |
| issue salience | 1 | 0 | 1 | 0.0 |
| degree of political conflict | 1 | 0 | 1 | 0.0 |
| inequality of opportunity vs outcome | 1 | 0 | 1 | 0.0 |
Edge and node attributes can be added using the edge_attributes and node_attributes arguments. edge_attributes is a vector that identifies columns in the supplied data frame that the user would like to retain. node_attributes is a separate dataframe that contains attributes for each node in the primary data set. The example node_attributes data include one column type indicating a type for each each node/variable/concept.
data("node_attributes")
node_attributes %>% kable()| node | type |
|---|---|
| campaign resource allocation | effect |
| candidate quality | effect |
| change in constituency boundaries | condition |
| preserve communities of interest | goal |
| competitiveness | goal |
| computers | condition |
| constitutional test | metric |
| contiguity | condition |
| sorting | condition |
| detect gerrymandering | goal |
| electorate composition change | condition |
| elite ideological moderation | effect |
| equal population | metric |
| floor votes align with district preferences | effect |
| house-senate delegation alignment | effect |
| incumbent vote share | effect |
| instability | effect |
| legislative majority-seeking behavior | effect |
| legislative outcomes | effect |
| legislator voting | effect |
| majority minority districts | policy |
| mean-median vote comparison | metric |
| minority representation | effect |
| number of competitive districts | goal |
| number of minority representatives | effect |
| partisan advantage | goal |
| partisan gerrymandering | condition |
| personal vote | effect |
| pork spending | policy |
| proportionality | goal |
| public participation | goal |
| redistricting by courts | policy |
| redistricting commission | policy |
| rolloff | effect |
| split ticket voting | effect |
| stability in voters’ fellow constituents | effect |
| upcoming redistricting | condition |
| voter information about their district | effect |
| voter sense of place | effect |
| voter turnout | effect |
| elite polarization | effect |
| geographic partisan distribution | condition |
| compactness | value |
| efficiency gap | metric |
| partisan dislocation | metric |
| wasted votes | metric |
| identification with governing party | condition |
| partisan donor advantage | effect |
| floor votes align with state preferences | effect |
| majority representation | effect |
| efficiency principle | metric |
| ideological representation | effect |
| support for redistricting process | effect |
| issue salience | effect |
| degree of political conflict | effect |
| inequality of opportunity vs outcome | effect |
lit <- review(literature,
edge_attributes = c("cites", "cites_empirical"),
node_attributes = node_attributes)
lit## A netlit_review object with the following components:
##
## $edgelist
## - 69 edges
## - edge attributes: cites, cites_empirical, edge_betweenness
## $nodelist
## - 56 nodes
## - node attributes: type, degree_in, degree_out, degree_total, betweenness
## $graph
## an igraph object
Tip: to retain all variables from literature, use edge_attributes = names(literature).
library(tidyverse)
library(magrittr)
library(ggraph)We separated multiple cites to a theorized relationship with semicolons. Let’s count the total number of citations and the number of citations to empirical work by splitting out each cite and measuring the length of that vector.
# count cites
literature %<>%
group_by(to, from) %>%
mutate(cite_weight = str_split(cites, ";")[[1]] %>% length(),
cite_weight_empirical = str_split(cites_empirical, ";",)[[1]] %>% length(),
cite_weight_empirical = ifelse(is.na(cites_empirical), 0, cite_weight_empirical)) %>%
ungroup()
# subsets
literature %<>% mutate(communities_node = str_c(to, from) %>% str_detect("Commun"),
confound = case_when(
from == "Preserve\nCommunities\nOf Interest" & to == "Rolloff" ~ T,
from == "Voter\nInformation\nAbout Their\nDistrict" & to == "Rolloff" ~ T,
from == "Preserve\nCommunities\nOf Interest"
& to == "Voter\nInformation\nAbout Their\nDistrict" ~ T,
T ~ F),
empirical = ifelse(!is.na(cites_empirical),
"Empirical work",
"No empirical work"))Now we use review() on this expanded edgelist, including all variables in the literature data with edge_attributes = names(literature).
# now with all node and edge attributes
lit <- review(literature,
edge_attributes = names(literature),
node_attributes = node_attributes
)
edges <- lit$edgelist
edges %>% kable()| from | to | cites | cites_empirical | cite_weight | cite_weight_empirical | communities_node | confound | empirical | edge_betweenness |
|---|---|---|---|---|---|---|---|---|---|
| Computers | Detect Gerrymandering | Altman & McDonald 2010; Wang 2016; Altman & McDonald 2011; Ramachandran & Gold 2018 | Wang 2016 | 4 | 1 | FALSE | FALSE | Empirical work | 2.0 |
| Computers | Public Participation | Altman & McDonald 2010; Altman & McDonald 2011 | NA | 2 | 0 | FALSE | FALSE | No empirical work | 1.0 |
| Number Of Competitive Districts | Preserve Communities Of Interest | Gimpel & Harbridge-Yong 2020 | Gimpel & Harbridge-Yong 2020 | 1 | 1 | TRUE | FALSE | Empirical work | 86.0 |
| Partisan Advantage | Proportionality | Caughey et al. 2017; Tamas 2019 | NA | 2 | 0 | FALSE | FALSE | No empirical work | 19.5 |
| Partisan Gerrymandering | Efficiency Gap | Chen 2017 | Chen 2017 | 1 | 1 | FALSE | FALSE | Empirical work | 13.5 |
| Preserve Communities Of Interest | Constitutional Test | Stephanopoulos 2012 | NA | 1 | 0 | TRUE | FALSE | No empirical work | 7.0 |
| Mean-Median Vote Comparison | Detect Gerrymandering | McDonald & Best 2015; Wang 2016; Wang 2016b | Wang 2016b | 3 | 1 | FALSE | FALSE | Empirical work | 2.0 |
| Mean-Median Vote Comparison | Constitutional Test | McDonald & Best 2015, Best et al. 2018 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 1.0 |
| Partisan Gerrymandering | Constitutional Test | Kang 2017 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 1.0 |
| Partisan Gerrymandering | Instability | Yoshinaka & Murhpy 2011 | Yoshinaka & Murhpy 2011 | 1 | 1 | FALSE | FALSE | Empirical work | 8.0 |
| Partisan Gerrymandering | Elite Polarization | Masket et al. 2012 | Masket et al. 2012 | 1 | 1 | FALSE | FALSE | Empirical work | 2.0 |
| Majority Minority Districts | Number Of Minority Representatives | Atsusaka 2021 | Atsusaka 2021 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Majority Minority Districts | Partisan Advantage | Cox & Holden 2011; Sabouni & Shelton 2021 | Sabouni & Shelton 2021 | 2 | 1 | FALSE | FALSE | Empirical work | 23.0 |
| Majority Minority Districts | Voter Turnout | Fraga 2016 | Fraga 2016 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Redistricting Commission | Partisan Advantage | Cain 2011 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 22.0 |
| Partisan Gerrymandering | Partisan Donor Advantage | Kirkland 2013 | Kirkland 2013 | 1 | 1 | FALSE | FALSE | Empirical work | 8.0 |
| Change In Constituency Boundaries | Legislator Voting | Bertelli & Carson 2011, Hayes et al. 2010 | Bertelli & Carson 2011, Hayes et al. 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Change In Constituency Boundaries | Legislative Outcomes | Bertelli & Carson 2011, Gul & Pesendorfer 2010 | Bertelli & Carson 2011 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Competitiveness | Voter Turnout | Moskowitz & Schneer 2019; Hunt 2018 | Moskowitz & Schneer 2019; Hunt 2018 | 2 | 2 | FALSE | FALSE | Empirical work | 3.0 |
| Sorting | Elite Polarization | Krasa & Polborn 2018 | Krasa & Polborn 2018 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Contiguity | Partisan Advantage | Chen & Rodden 2013 | Chen & Rodden 2013 | 1 | 1 | FALSE | FALSE | Empirical work | 24.0 |
| Electorate Composition Change | Incumbent Vote Share | Hood & McKee 2013; Ansolabehere & Snyder 2012 | Hood & McKee 2013; Ansolabehere & Snyder 2012 | 2 | 2 | FALSE | FALSE | Empirical work | 2.0 |
| Electorate Composition Change | Personal Vote | Carsey et al. 2017, Bertelli & Carson 2011 | Carsey et al. 2017 | 1 | 1 | FALSE | FALSE | Empirical work | 2.0 |
| House-Senate Delegation Alignment | Pork Spending | Chen 2010 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 12.0 |
| Stability In Voters’ Fellow Constituents | Voter Sense Of Place | Hayes & McKee 2011 | Hayes & McKee 2011 | 1 | 1 | FALSE | FALSE | Empirical work | 9.0 |
| Change In Constituency Boundaries | Voter Information About Their District | Winburn & Wagner 2010 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 4.0 |
| Voter Information About Their District | Rolloff | Winburn & Wagner 2010 | Winburn & Wagner 2010 | 1 | 1 | FALSE | TRUE | Empirical work | 2.0 |
| Voter Information About Their District | Voter Turnout | Winburn & Wagner 2010 | Winburn & Wagner 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 8.0 |
| Voter Information About Their District | Split Ticket Voting | Winburn & Wagner 2010 | Winburn & Wagner 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 10.0 |
| Electorate Composition Change | Campaign Resource Allocation | Limbocker & You 2020 | Limbocker & You 2020 | 1 | 1 | FALSE | FALSE | Empirical work | 2.0 |
| Geographic Partisan Distribution | Partisan Advantage | Chen & Rodden 2013; Duchin et al. 2019; Powell et al. 2020 | Chen & Rodden 2013; Duchin et al. 2019; Powell et al. 2020 | 3 | 3 | FALSE | FALSE | Empirical work | 24.0 |
| Preserve Communities Of Interest | Stability In Voters’ Fellow Constituents | Winburn & Wagner 2010 | NA | 1 | 0 | TRUE | FALSE | No empirical work | 16.0 |
| Preserve Communities Of Interest | Voter Information About Their District | Winburn & Wagner 2010 | NA | 1 | 0 | TRUE | TRUE | No empirical work | 22.0 |
| Preserve Communities Of Interest | Rolloff | Hayes & McKee 2011; Winburn & Wagner 2010 | Hayes & McKee 2011 | 2 | 1 | TRUE | TRUE | Empirical work | 8.0 |
| Number Of Competitive Districts | Elite Polarization | Grainger 2010 | Grainger 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Partisan Advantage | Floor Votes Align With District Preferences | Caughey et al. 2017 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 8.0 |
| Partisan Advantage | Floor Votes Align With State Preferences | Caughey et al. 2017 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 8.0 |
| Partisan Advantage | Partisan Advantage | Arrington 2016; Campisi et al. 2019; Katz, King & Rosenblatt 2020 | NA | 3 | 0 | FALSE | FALSE | No empirical work | 0.0 |
| Partisan Advantage | Legislator Voting | Lo 2013 | Lo 2013 | 1 | 1 | FALSE | FALSE | Empirical work | 8.0 |
| Partisan Advantage | Elite Polarization | Lo 2013 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 5.0 |
| Partisan Advantage | Efficiency Gap | Chen & Cottrell 2016 | Chen & Cottrell 2016 | 1 | 1 | FALSE | FALSE | Empirical work | 15.0 |
| Partisan Advantage | Number Of Competitive Districts | Goedert 2017; Goedert 2014 | Goedert 2017, Yoshinaka & Murhpy 2011; Goedert 2014 | 2 | 2 | FALSE | FALSE | Empirical work | 71.0 |
| Proportionality | House-Senate Delegation Alignment | Chen 2010 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 22.0 |
| Compactness | Minority Representation | Webster 2013 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 1.0 |
| Compactness | Compactness | Barnes & Solomon 2020; Gatesman & Unwin 2021; Magleby & Mosesson 2018; De Assis et al. 2014; Altman & McDonald 2011; Liu et al. 2016, Chen & Rodden 2015, Tam Cho & Liu 2016, Saxon 2020 | Barnes & Solomon 2020; Magleby & Mosesson 2018; De Assis et al. 2014; Chen & Rodden 2015, Tam Cho & Liu 2016, Saxon 2020 | 6 | 4 | FALSE | FALSE | Empirical work | 0.0 |
| Efficiency Gap | Efficiency Gap | Stephanopoulos & McGhee 2015, McGhee 2014 | McGhee 2014 | 1 | 1 | FALSE | FALSE | Empirical work | 0.0 |
| Equal Population | Equal Population | Gatesman & Unwin 2021; Magleby & Mosesson 2018 | Magleby & Mosesson 2018 | 2 | 1 | FALSE | FALSE | Empirical work | 0.0 |
| Redistricting Commission | Majority Representation | Matsusaka 2010 | Matsusaka 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Redistricting Commission | Elite Ideological Moderation | McGhee & Shor 2017 | McGhee & Shor 2017 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Redistricting Commission | Competitiveness | Carson et al. 2014, Grainger 2010, Masket et al. 2012; Goedert 2014 | Carson et al. 2014, Grainger 2010, Masket et al. 2012; Goedert 2014 | 2 | 2 | FALSE | FALSE | Empirical work | 2.0 |
| Redistricting By Courts | Competitiveness | Carson et al. 2014 | Carson et al. 2014 | 1 | 1 | FALSE | FALSE | Empirical work | 2.0 |
| Upcoming Redistricting | Legislative Majority-Seeking Behavior | Makse 2014 | Makse 2014 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Partisan Dislocation | Partisan Dislocation | Deford, Eubank & Rodden 2020 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 0.0 |
| Compactness | Voter Turnout | Ladewig 2018 | Ladewig 2018 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Preserve Communities Of Interest | Preserve Communities Of Interest | Makse 2012 | Makse 2012 | 1 | 1 | TRUE | FALSE | Empirical work | 0.0 |
| Partisan Gerrymandering | Partisan Advantage | Wang 2016; Cox & Holden 2011; Sabouni & Shelton 2021; Powell et al. 2020 | Cox & Holden 2011; Sabouni & Shelton 2021; Powell et al. 2020 | 4 | 3 | FALSE | FALSE | Empirical work | 25.5 |
| Preserve Communities Of Interest | Partisan Gerrymandering | Sabouni & Shelton 2021 | Sabouni & Shelton 2021 | 1 | 1 | TRUE | FALSE | Empirical work | 49.0 |
| Redistricting Commission | Candidate Quality | Williamson 2019 | Williamson 2019 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Efficiency Gap | Efficiency Principle | Veomett 2018 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 10.0 |
| Wasted Votes | Efficiency Gap | McGhee 2017 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 6.0 |
| Efficiency Gap | Ideological Representation | Caughey et al. 2017b | Caughey et al. 2017b | 1 | 1 | FALSE | FALSE | Empirical work | 10.0 |
| Identification With Governing Party | Support For Redistricting Process | Fougere et al. 2010 | Fougere et al. 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Redistricting Commission | Support For Redistricting Process | Fougere et al. 2010 | Fougere et al. 2010 | 1 | 1 | FALSE | FALSE | Empirical work | 1.0 |
| Efficiency Gap | Proportionality | Warrington 2018 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 10.5 |
| Change In Constituency Boundaries | Issue Salience | Gardner 2012 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 1.0 |
| Change In Constituency Boundaries | Degree Of Political Conflict | Gardner 2012 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 1.0 |
| Partisan Gerrymandering | Majority Representation | Goedert 2014; Nagle 2019 | NA | 2 | 0 | FALSE | FALSE | No empirical work | 7.0 |
| Detect Gerrymandering | Inequality Of Opportunity Vs Outcome | Wang et al. 2018 | NA | 1 | 0 | FALSE | FALSE | No empirical work | 3.0 |
| Change In Constituency Boundaries | Electorate Composition Change | Bertelli & Carson 2011; Hood & McKee 2013; Ansolabehere & Snyder 2012 | Bertelli & Carson 2011; Hood & McKee 2013; Ansolabehere & Snyder 2012 | 3 | 3 | FALSE | FALSE | Empirical work | 4.0 |
nodes <- lit$nodelist
nodes %>% kable()| node | type | degree_in | degree_out | degree_total | betweenness |
|---|---|---|---|---|---|
| Computers | condition | 0 | 2 | 2 | 0.0 |
| Number Of Competitive Districts | goal | 1 | 2 | 3 | 64.0 |
| Partisan Advantage | goal | 6 | 8 | 14 | 111.5 |
| Partisan Gerrymandering | condition | 1 | 7 | 8 | 42.0 |
| Preserve Communities Of Interest | goal | 2 | 6 | 8 | 79.0 |
| Mean-Median Vote Comparison | metric | 0 | 2 | 2 | 0.0 |
| Majority Minority Districts | policy | 0 | 3 | 3 | 0.0 |
| Redistricting Commission | policy | 0 | 6 | 6 | 0.0 |
| Change In Constituency Boundaries | condition | 0 | 6 | 6 | 0.0 |
| Competitiveness | goal | 2 | 1 | 3 | 2.0 |
| Sorting | condition | 0 | 1 | 1 | 0.0 |
| Contiguity | condition | 0 | 1 | 1 | 0.0 |
| Electorate Composition Change | condition | 1 | 3 | 4 | 3.0 |
| House-Senate Delegation Alignment | effect | 1 | 1 | 2 | 11.0 |
| Stability In Voters’ Fellow Constituents | effect | 1 | 1 | 2 | 8.0 |
| Voter Information About Their District | effect | 2 | 3 | 5 | 17.0 |
| Geographic Partisan Distribution | condition | 0 | 1 | 1 | 0.0 |
| Proportionality | goal | 2 | 1 | 3 | 20.0 |
| Compactness | value | 1 | 3 | 4 | 0.0 |
| Efficiency Gap | metric | 4 | 4 | 8 | 25.5 |
| Equal Population | metric | 1 | 1 | 2 | 0.0 |
| Redistricting By Courts | policy | 0 | 1 | 1 | 0.0 |
| Upcoming Redistricting | condition | 0 | 1 | 1 | 0.0 |
| Partisan Dislocation | metric | 1 | 1 | 2 | 0.0 |
| Wasted Votes | metric | 0 | 1 | 1 | 0.0 |
| Identification With Governing Party | condition | 0 | 1 | 1 | 0.0 |
| Detect Gerrymandering | goal | 2 | 1 | 3 | 2.0 |
| Public Participation | goal | 1 | 0 | 1 | 0.0 |
| Constitutional Test | metric | 3 | 0 | 3 | 0.0 |
| Instability | effect | 1 | 0 | 1 | 0.0 |
| Elite Polarization | effect | 4 | 0 | 4 | 0.0 |
| Number Of Minority Representatives | effect | 1 | 0 | 1 | 0.0 |
| Voter Turnout | effect | 4 | 0 | 4 | 0.0 |
| Partisan Donor Advantage | effect | 1 | 0 | 1 | 0.0 |
| Legislator Voting | effect | 2 | 0 | 2 | 0.0 |
| Legislative Outcomes | effect | 1 | 0 | 1 | 0.0 |
| Incumbent Vote Share | effect | 1 | 0 | 1 | 0.0 |
| Personal Vote | effect | 1 | 0 | 1 | 0.0 |
| Pork Spending | policy | 1 | 0 | 1 | 0.0 |
| Voter Sense Of Place | effect | 1 | 0 | 1 | 0.0 |
| Rolloff | effect | 2 | 0 | 2 | 0.0 |
| Split Ticket Voting | effect | 1 | 0 | 1 | 0.0 |
| Campaign Resource Allocation | effect | 1 | 0 | 1 | 0.0 |
| Floor Votes Align With District Preferences | effect | 1 | 0 | 1 | 0.0 |
| Floor Votes Align With State Preferences | effect | 1 | 0 | 1 | 0.0 |
| Minority Representation | effect | 1 | 0 | 1 | 0.0 |
| Majority Representation | effect | 2 | 0 | 2 | 0.0 |
| Elite Ideological Moderation | effect | 1 | 0 | 1 | 0.0 |
| Legislative Majority-Seeking Behavior | effect | 1 | 0 | 1 | 0.0 |
| Candidate Quality | effect | 1 | 0 | 1 | 0.0 |
| Efficiency Principle | metric | 1 | 0 | 1 | 0.0 |
| Ideological Representation | effect | 1 | 0 | 1 | 0.0 |
| Support For Redistricting Process | effect | 2 | 0 | 2 | 0.0 |
| Issue Salience | effect | 1 | 0 | 1 | 0.0 |
| Degree Of Political Conflict | effect | 1 | 0 | 1 | 0.0 |
| Inequality Of Opportunity Vs Outcome | effect | 1 | 0 | 1 | 0.0 |
igraph object# define igraph object as g
g <- lit$graph
g## IGRAPH b737837 DN-B 56 69 --
## + attr: name (v/c), type (v/c), degree_in (v/n), degree_out (v/n),
## | degree_total (v/n), betweenness (v/n), cites (e/c), cites_empirical
## | (e/c), cite_weight (e/n), cite_weight_empirical (e/n),
## | communities_node (e/l), confound (e/l), empirical (e/c),
## | edge_betweenness (e/n)
## + edges from b737837 (vertex names):
## [1] Computers ->Detect\nGerrymandering
## [2] Computers ->Public\nParticipation
## [3] Number Of\nCompetitive\nDistricts->Preserve\nCommunities\nOf Interest
## [4] Partisan\nAdvantage ->Proportionality
## + ... omitted several edges
What does it mean?
D means directedN means named graphW means weighted graphname (v/c) means name is a node attribute and it’s a charactercite_weight (e/n) means cite_weight is an edge attribute and it’s numericggraphWe can also plot using the package ggraph package to plot the igraph object.
This package allows us to plot self-ties, but it is slightly more difficult to use ggplot features (e.g. colors and legend labels) compared to ggnetwork.
# best seed 1,4, *5*
set.seed(5)
p <- ggraph(g, layout = 'fr') +
geom_node_point(
aes(color = degree_total %>% as.factor() ),
size = 6,
alpha = .7
) +
geom_edge_arc2(
aes(
start_cap = circle(3, 'mm'),
end_cap = circle(6, 'mm'),
color = cite_weight %>% as_factor(),
linetype = empirical
),
curvature = 0,
arrow = arrow(length = unit(2, 'mm'),
type = "open")
) +
geom_edge_loop(
aes( color = cite_weight %>% as_factor(),
start_cap = circle(5, 'mm'),
end_cap = circle(2, 'mm'),
linetype = empirical
),
n = 300,
strength = .6,
arrow = arrow(length = unit(2, 'mm'),
type = "open")
) +
geom_node_text( aes(label = name), size = 2.3) +
ggplot2::theme_void() +
theme(legend.position="bottom") +
labs(edge_color = "Number of\nPublications",
color = "Total Degree\nCentrality",
edge_linetype = "") +
scale_edge_color_viridis(discrete = TRUE,
option = "plasma",
begin = 0,
end = .9,
direction = -1) +
scale_color_viridis_d(option = "mako",
begin = 1,
end = .5)
p p + facet_wrap("communities_node")p + facet_wrap("confound")